package com.itcast.utils;

import lombok.Data;

import java.io.Serializable;

@Data
public class BizResult implements Serializable {

    // 返回状态
    private int status;
    // 状态描述
    private String desc;
    // 返回数据
    private Object data;

    private String token;

    private int code;

    public static BizResult ok(String message) {
        BizResult bizResult = new BizResult();
        bizResult.setStatus(200);
        bizResult.setCode(1);
        return bizResult;
    }

    public static BizResult fail(String message) {
        BizResult bizResult = new BizResult();
        bizResult.setStatus(500);
        bizResult.setCode(0);
        bizResult.setDesc("返回失败");
        return bizResult;
    }
}
